﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ProjectA.Controls;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data;
using System.Configuration;
using ProyectA;

namespace ProjectA.Modules.Costos.Facturas
{
    public class cWindowFacturas : cWindow
    {
        public cWindow panelCostosFacturasVer;
        wsGeneral.WsGeneral wsGeneral;
        private BindingSource bsProveedor;
        private BindingSource bsFacturasBackUp;
        cFacturas Factura;

        enum Modo { Agregar, Editar, Ver }

        private int CentroDeCostosId
        {
            get;
            set;
        }


        private Modo ModoActual { get; set; }

        public cWindowFacturas(frmPrincipal frmPrincipal, Point pPoint, Size sSize)
        {
            this.frmPrincipal = frmPrincipal;
            this.BackColor = Color.Transparent;
            this.Location = pPoint;
            this.Size = sSize;
            this.tssbConfigurarVerFacturaItems = false;
            InitializeComponent();
            InitComponent();
            wsGeneral = new wsGeneral.WsGeneral();
            //Datagrid
            for (int iCount = 0; iCount < dgvCostosFacturas.Columns.Count-1; iCount++)
            {
                dgvCostosFacturas.Columns[iCount].Visible = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                
                if (tsmiNoFactura.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiNoFactura.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiNoOrden.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiNoOrden.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiNoRadicacion.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiNoRadicacion.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiFechaRadicacion.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiFechaRadicacion.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiFechaRegistro.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiFechaRegistro.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiFechaFactura.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiFechaFactura.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiDiasVenci.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiDiasVenci.Checked =  bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiMoneda.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiMoneda.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiTRM.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiTRM.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiCostoTotalFactura.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiCostoTotalFactura.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiIVA.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiIVA.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiPorcentajeAvance.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiPorcentajeAvance.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiAmortizacionAvance.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiAmortizacionAvance.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiTotalDescuentos.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiTotalDescuentos.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiTotalCancelado.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiTotalCancelado.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else if (tsmiDiferencia.Name == dgvCostosFacturas.Columns[iCount].DataPropertyName)
                    tsmiDiferencia.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
                else
                    tsmiTotalPagar.Checked = bool.Parse(ConfigurationManager.AppSettings[dgvCostosFacturas.Columns[iCount].DataPropertyName]);
            }

            ModoActual = Modo.Ver;
            
        }

        #region panelCostosFacturasAgregar

        void cbCostosFacturaAgregarMoneda_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbCostosFacturaAgregarMoneda.SelectedIndex != -1)
            {
                if (cbCostosFacturaAgregarMoneda.SelectedIndex == 1)
                {
                    Factura.Moneda = "USD";
                    tbCostosFacturasAgregarTRM.ReadOnly = false;
                    tbCostosFacturasAgregarIVA.ReadOnly = true;
                    chbCostosFacturasAgregarIVADeducible.Enabled = false;
                }
                else
                {
                    Factura.Moneda = "COP";
                    Factura.TRM = 0;
                    tbCostosFacturasAgregarTRM.Text = "";
                    tbCostosFacturasAgregarTRM.ReadOnly = true;
                    //tbCostosFacturasAgregarIVA.Text = "";
                    tbCostosFacturasAgregarIVA.ReadOnly = false;
                    chbCostosFacturasAgregarIVADeducible.Enabled = true;
                }
            }

        }

        private void btGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                int iRegistro;
                string sError;
                int iDiasVencido = (dtpCostosFacturasAgregarFechaRegistro.Value.Subtract(dtpCostosFacturasAgregarFechaFactura.Value)).Days;

                if (ModoActual == Modo.Agregar)
                {
                    if (wsGeneral.AddRegistroFacturas(int.Parse(tbCostosFacturasAgregarNoFactura.Text),
                        int.Parse(cbCostosFacturasAgregarOcOs.Text), CentroDeCostosId,
                        int.Parse(tbCostosFacturasAgregarCodigoUnicoContable.Text), int.Parse(tbCostosFacturasAgregarNoRadicacion.Text), 
                        dtpCostosFacturasAgregarFechaDeRadicacion.Value,
                        dtpCostosFacturasAgregarFechaRegistro.Value, dtpCostosFacturasAgregarFechaFactura.Value, iDiasVencido, Factura.TRM,
                        cbCostosFacturaAgregarMoneda.Text, Factura.TotalFacturadoNeto, Factura.IVA,
                        Factura.ReteIva, Factura.ReteIva, Factura.PReteRenta, Factura.ReteRenta, Factura.PReteICA, Factura.ReteICA, Factura.PAvance,
                        Factura.Amortizacion, Factura.TotalDescuentos, Factura.TotalAPagar, Factura.TotalCancelado, Factura.PagarAProveedor,
                        out iRegistro, out sError))
                    {
                        MessageBox.Show("Registro completado. Por favor adicione los elementos asociados a esta Factura", "ProjectA", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                        DataRow dr = dsPrincipal.Tables["Facturas"].NewRow();
                        dr["ID"] = iRegistro;
                        dr["NoFactura"] = int.Parse(tbCostosFacturasAgregarNoFactura.Text);
                        dr["NoOrden"] = int.Parse(cbCostosFacturasAgregarOcOs.Text);
                        dr["CodigoUnicoConta"] = int.Parse(tbCostosFacturasAgregarCodigoUnicoContable.Text);
                        dr["NoRadicacion"] = int.Parse(tbCostosFacturasAgregarNoRadicacion.Text);
                        dr["FechaRadicacion"] = dtpCostosFacturasAgregarFechaDeRadicacion.Value;
                        dr["FechaRegistro"] = dtpCostosFacturasAgregarFechaRegistro.Value;
                        dr["FechaFactura"] = dtpCostosFacturasAgregarFechaFactura.Value;
                        dr["DiasVencimiento"] = dtpCostosFacturasAgregarFechaFactura.Value;
                        dr["TRM"] = Factura.TRM;
                        dr["Moneda"] = cbCostosFacturaAgregarMoneda.Text;
                        dr["CostoTotalFactura"] = Factura.TotalFacturadoNeto;
                        dr["IVA"] = Factura.IVA;
                        dr["PorcentajeAvance"] = Factura.PAvance;
                        dr["AmortizacionAvance"] = Factura.PAvance;
                        dr["TotalDescuentos"] = Factura.TotalDescuentos;
                        dr["TotalPagar"] = Factura.TotalAPagar;
                        dr["TotalCancelado"] = Factura.TotalCancelado;
                        dr["Diferencia"] = Factura.PagarAProveedor;
                        dsPrincipal.Tables["Facturas"].Rows.Add(dr);

                        formElementosFactura ElementosFactura = new formElementosFactura(Factura.TotalFacturadoNeto, CentroDeCostosId, iRegistro);
                        ElementosFactura.Show();
                        ElementosFactura.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.formElementosFactura_FormClosed);
                    }
                    else
                    {
                        MessageBox.Show("Adición errónea: " + sError);
                    }
                }
                else
                {
                    if (wsGeneral.ModifyRegistroFacturas(int.Parse(dgvCostosFacturas.Rows[FilaActual].Cells["ID"].Value.ToString()), int.Parse(tbCostosFacturasAgregarNoFactura.Text),
                        int.Parse(cbCostosFacturasAgregarOcOs.Text), CentroDeCostosId,
                         int.Parse(tbCostosFacturasAgregarCodigoUnicoContable.Text), int.Parse(tbCostosFacturasAgregarNoRadicacion.Text), dtpCostosFacturasAgregarFechaDeRadicacion.Value,
                         dtpCostosFacturasAgregarFechaRegistro.Value, dtpCostosFacturasAgregarFechaFactura.Value, iDiasVencido, Factura.TRM,
                         cbCostosFacturaAgregarMoneda.Text, Factura.TotalFacturadoNeto, Factura.IVA,
                         Factura.ReteIva, Factura.ReteIva, Factura.PReteRenta, Factura.ReteRenta, Factura.PReteICA, Factura.ReteICA, Factura.PAvance,
                         Factura.Amortizacion, Factura.TotalDescuentos, Factura.TotalAPagar, Factura.TotalCancelado, Factura.PagarAProveedor, out sError))
                    {
                        MessageBox.Show("Modificación exitosa", "ProjectA", MessageBoxButtons.OK);
                        

                        panelCostosFacturasAgregar.Visible = false;
                        panelCostosFacturasVer.Visible = true;
                        int i;
                        for (i = 0; i < dsPrincipal.Tables["Facturas"].Rows.Count; i++)
                        {
                            if (dgvCostosFacturas.Rows[FilaActual].Cells["ID"].Value.ToString() == dsPrincipal.Tables["Facturas"].Rows[i]["ID"].ToString())
                                break;
                        }
                        dsPrincipal.Tables["Facturas"].Rows[i][1] = tbCostosFacturasAgregarNoFactura.Text;
                        dsPrincipal.Tables["Facturas"].Rows[i][2] = cbCostosFacturasAgregarOcOs.Text;
                        dsPrincipal.Tables["Facturas"].Rows[i][4] = tbCostosFacturasAgregarCodigoUnicoContable.Text;
                        dsPrincipal.Tables["Facturas"].Rows[i][5] = tbCostosFacturasAgregarNoRadicacion.Text;
                        dsPrincipal.Tables["Facturas"].Rows[i][6] = dtpCostosFacturasAgregarFechaDeRadicacion.Value;
                        dsPrincipal.Tables["Facturas"].Rows[i][7] = dtpCostosFacturasAgregarFechaRegistro.Value;
                        dsPrincipal.Tables["Facturas"].Rows[i][8] = dtpCostosFacturasAgregarFechaFactura.Value;
                        dsPrincipal.Tables["Facturas"].Rows[i]["DiasVencimiento"] = iDiasVencido;
                        dsPrincipal.Tables["Facturas"].Rows[i]["TRM"] = tbCostosFacturasAgregarTRM.Text;
                        dsPrincipal.Tables["Facturas"].Rows[i]["Moneda"] = cbCostosFacturaAgregarMoneda.Text;
                        dsPrincipal.Tables["Facturas"].Rows[i]["CostoTotalFactura"] = Factura.TotalFacturadoNeto;
                        dsPrincipal.Tables["Facturas"].Rows[i]["PorcentajeAvance"] = Factura.PAvance;
                        dsPrincipal.Tables["Facturas"].Rows[i]["AmortizacionAvance"] = Factura.Amortizacion;
                        dsPrincipal.Tables["Facturas"].Rows[i]["TotalDescuentos"] = Factura.TotalDescuentos;
                        dsPrincipal.Tables["Facturas"].Rows[i]["TotalPagar"] = Factura.TotalAPagar;
                        dsPrincipal.Tables["Facturas"].Rows[i]["TotalCancelado"] = Factura.TotalCancelado;
                        dsPrincipal.Tables["Facturas"].Rows[i]["Diferencia"] = Factura.PagarAProveedor;

                        if (Factura.OldTotalFacturado != Factura.TotalFacturadoNeto)
                        {
                            MessageBox.Show("El valor facturado incialmente cambió, razón por la que debes modificar el valor de los items asociados");
                            formElementosFactura ElementosFactura = new formElementosFactura(Factura.TotalFacturadoNeto, CentroDeCostosId, int.Parse(dgvCostosFacturas.Rows[FilaActual].Cells["ID"].Value.ToString()));
                            ElementosFactura.Show();
                            ElementosFactura.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.formElementosFactura_FormClosed);
                        }
                        //CargarInformacionFacturas(CentroDeCostosId);
                    }
                }
            }
            catch (Exception Exc)
            {

            }
        }

        private void formElementosFactura_FormClosed(object sender, FormClosedEventArgs e)
        {
            panelCostosFacturasVer.Visible = true;
            panelCostosFacturasAgregar.Visible = false;

        }

        private void TotalesAcumulados()
        {
            tbCostosFacturasAgregarTotalDescuentos.Text = Factura.TotalDescuentos.ToString("C");
            tbCostosFacturasAgregarTotalAPagar.Text = Factura.TotalAPagar.ToString("C");
            lCostosFacturasAgregarTotalPagarAProveedor.Text = Factura.PagarAProveedor.ToString("C");
        }


        private void tbCostosFacturaAgregarTotalFacturado_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (tbCostosFacturaAgregarTotalFacturado.Text != "")
                {
                    Factura.TotalFacturado = float.Parse(tbCostosFacturaAgregarTotalFacturado.Text);
                }
                else
                {
                    Factura.TotalFacturado = 0;
                }
                TotalesAcumulados();
            }
            catch (Exception exc)
            {
                MessageBox.Show("Entrada no valida");
               
            }
        }

        private void chbCostosFacturasAgregarIVADeducible_CheckedChanged(object sender, EventArgs e)
        {
            Factura.IVADiferido = chbCostosFacturasAgregarIVADeducible.Checked;
            TotalesAcumulados();
        }

        private void tbCostosFacturasAgregarIVA_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (tbCostosFacturasAgregarIVA.Text != "")
                {
                    Factura.IVA = float.Parse(tbCostosFacturasAgregarIVA.Text);
                }
                else
                {
                    Factura.IVA = 0;
                }
                TotalesAcumulados();
            }
            catch (Exception exc)
            {
                MessageBox.Show("Entrada no valida");
                tblCostosFacturasAgregarPAvance.SelectionStart = tblCostosFacturasAgregarPAvance.Text.Length + 1;
                tblCostosFacturasAgregarPAvance.SelectionLength = 1;
            }

        }

        private void tbCostosFacturasAgregarTotalCancelado_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (tbCostosFacturasAgregarTotalCancelado.Text != "")
                    Factura.TotalCancelado = float.Parse(tbCostosFacturasAgregarTotalCancelado.Text);
                else
                    Factura.TotalCancelado = 0;
                TotalesAcumulados();

            }
            catch (Exception exc)
            {
                MessageBox.Show("Entrada no valida");
                tblCostosFacturasAgregarPAvance.SelectAll();
            }
        }

        private void tblCostosFacturasAgregarPAvance_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (tblCostosFacturasAgregarPAvance.Text != "")
                {
                    Factura.PAvance = float.Parse(tblCostosFacturasAgregarPAvance.Text);
                }
                else
                {
                    Factura.PAvance = 0;
                }

                tbCostosFacturasAgregarAmortizacionAvance.Text = Factura.Amortizacion.ToString("C");
                TotalesAcumulados();
            }
            catch (Exception exc)
            {
                MessageBox.Show("Entrada no valida");
                tblCostosFacturasAgregarPAvance.SelectAll();
            }

        }

        void tbCostosFacturasAgregarTRM_TextChanged(object sender, EventArgs e)
        {
            try
            {
                if (tbCostosFacturasAgregarTRM.Text != "")
                {
                    Factura.TRM = float.Parse(tbCostosFacturasAgregarTRM.Text); ;
                }
                else
                {
                    Factura.TRM = 0;
                }
                TotalesAcumulados();
            }
            catch (Exception exc)
            {
                MessageBox.Show("Entrada no valida");
                tbCostosFacturasAgregarTRM.SelectAll();
            }
        }

        private void btEliminar_Click(object sender, EventArgs e)
        {
            panelCostosFacturasVer.Visible = true;
            panelCostosFacturasAgregar.Visible = false;
        }

        #endregion

        #region PanelCostosFacturasVer

        private int FilaActual { get; set; }

       
        private void bindingNavigatorAddNewItem_Click(object sender, EventArgs e)
        {
            panelCostosFacturasVer.Visible = false;
            panelCostosFacturasAgregar.Visible = true;
            Factura = new cFacturas();
            bsOrdenes.Position = -1;
           
            ModoActual = Modo.Agregar;
            tbCostosFacturasAgregarNoFactura.Text = "";
            tbCostosFacturasAgregarNoRadicacion.Text = "";
            tbCostosFacturasAgregarTotalAPagar.Text = "";
            cbCostosFacturaAgregarMoneda.SelectedIndex = -1;
            cbCostosFacturasAgregarOcOs.SelectedIndex = -1;
            tbCostosFacturasAgregarTotalCancelado.Text = "";
            tbCostosFacturasAgregarCodigoUnicoContable.Text = "";
            tbCostosFacturasAgregarIVA.Text = "";
            tbCostosFacturasAgregarTRM.Text = "";
            tblCostosFacturasAgregarPAvance.Text = "";
          
        }

        private void tsbExportarFactura_Click(object sender, EventArgs e)
        {
            Excel.ExportarAArchivo(dgvCostosFacturas);
        }

        private void tsbImportarFactura_Click(object sender, EventArgs e)
        {
            DataSet datos = new DataSet();
            datos = Excel.ImportarOrdenesDesdeArchivo();
            wsGeneral.AgregarFacturasDesdeArchivo(CentroDeCostosId, datos);
        }

        //  
 

        private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e)
        {
            string sErr = "";
            DialogResult DialogResult = new DialogResult();
            DialogResult = MessageBox.Show("¿Esta Seguro de eliminar la factura No." + dgvCostosFacturas.Rows[FilaActual].Cells["NoFactura"].Value.ToString() + "?", "ProjectA", MessageBoxButtons.YesNo);
            if (DialogResult == System.Windows.Forms.DialogResult.Yes)
            {
                if (wsGeneral.DeleteRegistroFacturas(int.Parse(dgvCostosFacturas.Rows[FilaActual].Cells["ID"].Value.ToString()), out sErr))
                {
                    MessageBox.Show("Eliminación Exitosa");
                    dsPrincipal.Tables["Facturas"].Rows[FilaActual].Delete();
                    //CargarInformacionFacturas(this.CentroDeCostosId);
                }
            }
        }

        private void tsbVerElementosAsociados_Click(object sender, EventArgs e)
        {
            if (dgvCostosFacturas.Rows.Count > 0)
            {
                formElementosFactura ElementosAsociados = new formElementosFactura(float.Parse(dgvCostosFacturas.Rows[FilaActual].Cells["CostoTotalFactura"].Value.ToString()), CentroDeCostosId, int.Parse(dgvCostosFacturas.Rows[FilaActual].Cells["ID"].Value.ToString()));
                ElementosAsociados.Show();
            }
        }


        public void CargarInformacionFacturas(int iCentroDeCostosID)
        {
            string sErr = "";
            CentroDeCostosId = iCentroDeCostosID;

            DataSet dsFacturas = new DataSet();

            if (wsGeneral.GetRegistroFacturas(null, null, null, CentroDeCostosId, null, null, null, null, null, null, null,
                null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, out dsFacturas, out sErr))
            {
                bsFacturasBackUp.DataSource = dsFacturas;
                bsFacturasBackUp.DataMember = dsFacturas.Tables[0].TableName;
                dsPrincipal.Tables["Facturas"].Clear();
                dsPrincipal.Load(dsFacturas.CreateDataReader(), LoadOption.OverwriteChanges, "Facturas");
                LoadOrdenesCS();
                LoadProveedores();
            }
            else
            {
                MessageBox.Show("No hay facturas para este proyecto" + sErr);
            }
            this.tbCostosFacturasAgregarNIT.Text = "";
            this.tbCostosFacturasAgregarProveedor.Text = "";
        }

        #region Filtro

        private int? IntParseToNull(string categoryId)
        {
            int id;
            return int.TryParse(categoryId, out id) ? (int?)id : null;
        }

        private DateTime? DateTimeParseToNull(string categoryId)
        {
            DateTime id;
            return DateTime.TryParse(categoryId, out id) ? (DateTime?)id : null;

        }

        private float? FloatParseToNull(string categoryId)
        {
            float id;
            return float.TryParse(categoryId, out id) ? (float?)id : null;

        }

        private void btCostosFacturasVerBuscar_Click(object sender, EventArgs e)
        {
            this.tsbQuitarFiltro.Enabled = true;
            Factura = new cFacturas();
            Factura.FiltroCentroID = CentroDeCostosId;
            Factura.FiltroFechaInicial = new DateTime(dtpCostosFacturasVerFechaInicial.Value.Year, dtpCostosFacturasVerFechaInicial.Value.Month, dtpCostosFacturasVerFechaInicial.Value.Day, 0, 0, 0);
            Factura.FiltroFechaFinal = new DateTime(dtpCostosFacturasVerFechaFinal.Value.Year, dtpCostosFacturasVerFechaFinal.Value.Month, dtpCostosFacturasVerFechaFinal.Value.Day + 1, 0, 0, 0); ;


            switch (cbCostosFacturasVerFiltrarPor.SelectedIndex)
            {
                case 0:
                    Factura.FiltroNoFactura = IntParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 1:
                    Factura.FiltroNoOrden = IntParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 2:
                    Factura.FiltroCodigoUnicoConta = IntParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                //case 3:
                //    Factura.FiltroNoRadicacion = IntParseToNull(cbCostosFacturasVerFiltro.Text);
                //    break;

                case 3:
                    Factura.FiltroFechaRadicacion = DateTimeParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 4:
                    Factura.FiltroFechaFactura = DateTimeParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 5:
                    Factura.FiltroMoneda = cbCostosFacturasVerFiltro.Text;
                    break;

                case 6:
                    Factura.FiltroTRM = FloatParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 7:
                    Factura.FiltroCostoTotalFactura = FloatParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 8:
                    Factura.FiltroIVA = FloatParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;

                case 9:
                    Factura.FiltroPagarAProveedor = FloatParseToNull(cbCostosFacturasVerFiltro.Text);
                    break;
                case 10:
                    Factura.FiltroProveedorID = IntParseToNull(cbCostosFacturasVerFiltro.SelectedValue.ToString());
                    break;
                default:
                    break;

            }


            DataSet dsFacturas = new DataSet();
            dsFacturas = Factura.FiltarBusqueda();

            dsPrincipal.Tables["Facturas"].Clear();
            dsPrincipal.Load(dsFacturas.CreateDataReader(), LoadOption.OverwriteChanges, "Facturas");

        }

        private void cbCostosFacturasVerFiltrarPor_SelectedIndexChanged(object sender, EventArgs e)
        {
            cbCostosFacturasVerFiltro.ValueMember = null;
          
            switch (cbCostosFacturasVerFiltrarPor.SelectedIndex)
            {
                case 0:

                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "NoFactura";
                    break;

                case 1:
                    LoadOrdenesCS();
                    cbCostosFacturasVerFiltro.DataSource = bsOrdenes; //Consultar bsOSOC!!!
                    cbCostosFacturasVerFiltro.DisplayMember = "NumPoSo";
                    break;

                case 2:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "CodigoUnicoCont";
                    break;

                //case 3:
                //    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                //    cbCostosFacturasVerFiltro.DisplayMember = "CodigoUnicoCont";
                //    break;

                case 3:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "FechaRadicacion";
                    break;

                case 4:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "FechaFactura";
                    break;

                case 5:
                    cbCostosFacturasVerFiltro.DataSource = null;
                    cbCostosFacturasVerFiltro.DisplayMember = null;
                    cbCostosFacturasVerFiltro.ValueMember = null;
                    cbCostosFacturasVerFiltro.Items.Add("COP");
                    cbCostosFacturasVerFiltro.Items.Add("USD");
                    break;

                case 6:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "TRM";
                    break;

                case 7:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "CostoTotalFactura";
                    break;

                case 8:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "IvaFactura";
                    break;

                case 9:
                    cbCostosFacturasVerFiltro.DataSource = bsFacturasBackUp;
                    cbCostosFacturasVerFiltro.DisplayMember = "TotalPagar";
                    break;

                case 10:
                    cbCostosFacturasVerFiltro.DataSource = bsProveedor;
                    cbCostosFacturasVerFiltro.DisplayMember = "NameProvider";
                    cbCostosFacturasVerFiltro.ValueMember = "ID";
                    break;

                default:
                    cbCostosFacturasVerFiltro.DataSource = null;
                    cbCostosFacturasVerFiltro.DisplayMember = null;
                    break;

            }
            cbCostosFacturasVerFiltro.SelectedIndex = -1;
        }

        private void tsbQuitarFiltro_Click(object sender, EventArgs e)
        {
            CargarInformacionFacturas(this.CentroDeCostosId);
            tsbQuitarFiltro.Enabled = false;
            cbCostosFacturasVerFiltrarPor.SelectedIndex = -1;
        }

        #endregion

        private void LoadOrdenesCS()
        {
            DataSet dsPoSo = new DataSet();
            DataSet dsElementosPoSo = new DataSet();
            DataSet dsProveedores = new DataSet();
            string sErr;
            if (wsGeneral.GetPoSo(null, null, null, null, null, null, null, null, out dsPoSo, out sErr))
            {
                dsPrincipal.Tables["OrdenCompraServicios"].Clear();
                dsPrincipal.Load(dsPoSo.CreateDataReader(), LoadOption.OverwriteChanges, "OrdenCompraServicios");
            }
        }

        private void LoadProveedores()
        {
            DataSet dsProveedores = new DataSet();
            string sErr;
            if (wsGeneral.GetProviders(null, null, null, null, null, null, null, null, out dsProveedores, out sErr))
            {
                dsPrincipal.Tables["Proveedores"].Clear();
                dsPrincipal.Load(dsProveedores.CreateDataReader(), LoadOption.OverwriteChanges, "Proveedores");
            }
        }

        private void dgvCostosFacturas_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if(e.RowIndex!=-1)
                FilaActual = e.RowIndex;
        }

        private void tsbEditarFactura_Click(object sender, EventArgs e)
        {
            panelCostosFacturasVer.Visible = false;
            panelCostosFacturasAgregar.Visible = true;
            tbCostosFacturasAgregarTRM.Text = "";
            tbCostosFacturaAgregarTotalFacturado.Text = "";
            tbCostosFacturasAgregarIVA.Text = "";
            tblCostosFacturasAgregarPAvance.Text = "";
            Factura = new cFacturas();
            bsOrdenes.Position = -1;
            cbCostosFacturasAgregarOcOs.SelectedIndex = -1;
            tbCostosFacturasAgregarNoFactura.Text = dgvCostosFacturas.Rows[FilaActual].Cells["NoFactura"].Value.ToString();
            tbCostosFacturasAgregarNoRadicacion.Text = dsPrincipal.Tables["Facturas"].Rows[FilaActual]["NoRadicacion"].ToString();
            cbCostosFacturasAgregarOcOs.Text = dgvCostosFacturas.Rows[FilaActual].Cells["NoOrden"].Value.ToString();
            dtpCostosFacturasAgregarFechaDeRadicacion.Value = Convert.ToDateTime(dgvCostosFacturas.Rows[FilaActual].Cells["FechaRadicacion"].Value.ToString());
            tbCostosFacturasAgregarCodigoUnicoContable.Text = dgvCostosFacturas.Rows[FilaActual].Cells["CodigoUnicoCont"].Value.ToString();
            tbCostosFacturaAgregarTotalFacturado.Text = dgvCostosFacturas.Rows[FilaActual].Cells["CostoTotalFactura"].Value.ToString();
            tbCostosFacturasAgregarIVA.Text = dgvCostosFacturas.Rows[FilaActual].Cells["IvaFactura"].Value.ToString();
           
            if (tbCostosFacturasAgregarIVA.Text != "0")
                chbCostosFacturasAgregarIVADeducible.Checked = true;
            else
                chbCostosFacturasAgregarIVADeducible.Checked = false;

            tblCostosFacturasAgregarPAvance.Text = dgvCostosFacturas.Rows[FilaActual].Cells["PorcentajeAvance"].Value.ToString();
            tbCostosFacturasAgregarTotalCancelado.Text = dgvCostosFacturas.Rows[FilaActual].Cells["TotalDescuentos"].Value.ToString();
            tbCostosFacturasAgregarTotalAPagar.Text = dgvCostosFacturas.Rows[FilaActual].Cells["TotalPagar"].Value.ToString();
            cbCostosFacturaAgregarMoneda.Text = dgvCostosFacturas.Rows[FilaActual].Cells["Moneda"].Value.ToString();
            Factura.Moneda = cbCostosFacturaAgregarMoneda.Text;
            tbCostosFacturasAgregarTRM.Text = dgvCostosFacturas.Rows[FilaActual].Cells["TRM"].Value.ToString();
            tblCostosFacturasAgregarPAvance.Text = dgvCostosFacturas.Rows[FilaActual].Cells["PorcentajeAvance"].Value.ToString();
            tbCostosFacturasAgregarTotalCancelado.Text = dgvCostosFacturas.Rows[FilaActual].Cells["TotalCancelado"].Value.ToString();
            Factura.OldTotalFacturado = float.Parse(dgvCostosFacturas.Rows[FilaActual].Cells["CostoTotalFactura"].Value.ToString());

            ModoActual = Modo.Editar;


            
        }


        #region Configuración de columnas DataGrid Ver Factura

        private void VisualizarColumna(ToolStripMenuItem tsmiMenuActual, string sNombre)
        {
            Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            config.AppSettings.Settings[sNombre].Value = tsmiMenuActual.Checked.ToString();
            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
            tssbConfigurarVerFacturaItems = true;
            dgvCostosFacturas.Columns[sNombre].Visible = tsmiMenuActual.Checked;
        }

        private void tsmiNoFactura_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiNoFactura, "NoFactura");
        }

        private void tsmiTRM_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiTRM, "TRM");
        }

        private void tsmiTotalCancelado_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiTotalCancelado, "TotalCancelado");
        }

        private void tsmiDiferencia_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiDiferencia, "Diferencia");
        }
        
        private void tsmiNoOrden_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiNoOrden, "NoOrden");
        }

        private void tsmiNoRadicacion_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiNoRadicacion, "CodigoUnicoCont");

        }

        private void tsmiFechaRadicacion_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiFechaRadicacion, "FechaRadicacion");
        }

        private void tsmiFechaRegistro_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiFechaRegistro, "FechaRegistro");
        }

        private void tsmiFechaFactura_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiFechaFactura, "FechaFactura");
        }

        private void tsmiDiasVenci_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiDiasVenci, "DiasVencimiento");
        }

        private void tsmiMoneda_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiMoneda, "Moneda");
        }

        private void tsmiIVA_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiIVA, "IvaFactura");
        }

        private void tsmiTotalPagar_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiTotalPagar, "TotalPagar");
        }

        private void tsmiCostoTotalFactura_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiCostoTotalFactura, "CostoTotalFactura");
        }

        private void tsmiPorcentajeAvance_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiPorcentajeAvance, "PorcentajeAvance");
        }

        private void tsmiAmortizacionAvance_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiAmortizacionAvance, "AmortizacionAvance");
        }

        private void tsmiTotalDescuentos_Click(object sender, EventArgs e)
        {
            VisualizarColumna(tsmiTotalDescuentos, "TotalDescuentos");
        }

        public bool tssbConfigurarVerFacturaItems { get; set; }

        private void tssbConfigurarVerFactura_Closing(object sender, ToolStripDropDownClosingEventArgs e)
        {
            if (tssbConfigurarVerFacturaItems)
            {
                e.Cancel = true;
                tssbConfigurarVerFacturaItems = false;
            }
        }


        private void tssbConfigurarVerFactura_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            tssbConfigurarVerFacturaItems = true;
        }


        # endregion

        #endregion

        #region Creación de controles

        private void InitComponent()
        {
            this.resources = new System.ComponentModel.ComponentResourceManager(typeof(frmPrincipal));

            // ----------------------------------------------------------------------------------------------------------------------------------------------------------
            // Window panelCostosFacturasVer
            // ----------------------------------------------------------------------------------------------------------------------------------------------------------
            this.panelCostosFacturasVer.Location = new Point(0, 0);
            this.dgvCostosFacturas.Location = new Point(20, 38);
            this.lCostosFacturasVerFechaInicial = new cLabel(new Point(20, 350), new Size(100, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Fecha Inicial:");
            this.lCostosFacturasVerFechaFinal = new cLabel(new Point(20, 390), new Size(89, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Fecha Final:");
            this.lCostosFacturasVerFiltro = new cLabel(new Point(330, 350), new Size(49, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Filtro:");
            this.lCostosFacturasVerFiltrarPor = new cLabel(new Point(330, 390), new Size(82, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Filtrar por:");
            this.dtpCostosFacturasVerFechaInicial.Location = new Point(130, 344);
            this.dtpCostosFacturasVerFechaFinal.Location = new Point(130, 384);
            this.cbCostosFacturasVerFiltrarPor.Location = new Point(422, 347);
            this.cbCostosFacturasVerFiltro.Location = new Point(422, 387);
            this.btCostosFacturasVerBuscar = new cButton(new Point(637, 356), new Size(145, 46), new EventHandler(btCostosFacturasVerBuscar_Click), Properties.Resources.bt_tag_costos_buscar_1, Properties.Resources.bt_tag_costos_buscar_2, Properties.Resources.bt_tag_costos_buscar_3, Properties.Resources.bt_tag_costos_buscar_4);
            // ----------------------------------------------------------------------------------------------------------------------------------------------------------
            // BindingNavigator bnCostosFacturasVer
            // ----------------------------------------------------------------------------------------------------------------------------------------------------------
            #region bnCostosFacturasVer
            this.bnCostosFacturasVer = new BindingNavigator(new Container());
            this.bindingNavigatorMovePreviousItem = new ToolStripButton();
            this.bindingNavigatorSeparator = new ToolStripSeparator();
            this.bindingNavigatorPositionItem = new ToolStripTextBox();
            this.bindingNavigatorCountItem = new ToolStripLabel();
            this.bindingNavigatorMoveFirstItem = new ToolStripButton();
            this.bindingNavigatorSeparator1 = new ToolStripSeparator();
            this.bindingNavigatorMoveNextItem = new ToolStripButton();
            this.bindingNavigatorMoveLastItem = new ToolStripButton();
            this.bindingNavigatorSeparator2 = new ToolStripSeparator();
            this.bindingNavigatorAddNewItem = new ToolStripButton();
            this.tsbEditarFactura = new ToolStripButton();
            this.bnVerFacturasEliminarFactura = new ToolStripButton();
            this.tsbVerElementosAsociados = new ToolStripButton();
            this.tssbConfigurarVerFactura = new ToolStripSplitButton();
            this.tsbQuitarFiltro = new ToolStripButton();
            this.tsbImportarFactura = new ToolStripButton();
            this.tsbExportarFactura = new ToolStripButton();

            this.tsmiNoFactura = new ToolStripMenuItem();
            this.tsmiNoOrden = new ToolStripMenuItem();
            this.tsmiNoRadicacion = new ToolStripMenuItem();
            this.tsmiFechaRadicacion = new ToolStripMenuItem();
            this.tsmiFechaRegistro = new ToolStripMenuItem();
            this.tsmiFechaFactura = new ToolStripMenuItem();
            this.tsmiDiasVenci = new ToolStripMenuItem();
            this.tsmiMoneda = new ToolStripMenuItem();
            this.tsmiTRM = new ToolStripMenuItem();
            this.tsmiIVA = new ToolStripMenuItem();
            this.tsmiTotalPagar = new ToolStripMenuItem();
            this.tsmiCostoTotalFactura = new ToolStripMenuItem();
            this.tsmiPorcentajeAvance = new ToolStripMenuItem();
            this.tsmiAmortizacionAvance = new ToolStripMenuItem();
            this.tsmiTotalDescuentos = new ToolStripMenuItem();
            this.tsmiTotalCancelado = new ToolStripMenuItem();
            this.tsmiDiferencia = new ToolStripMenuItem();
            ((ISupportInitialize)(this.bnCostosFacturasVer)).BeginInit();
            this.bnCostosFacturasVer.SuspendLayout();
            // 
            // bnCostosFacturasVer
            // 
            this.bnCostosFacturasVer.AddNewItem = this.bindingNavigatorAddNewItem;
            this.bnCostosFacturasVer.AutoSize = false;
            this.bnCostosFacturasVer.BindingSource = this.bsFacturas;
            this.bnCostosFacturasVer.CountItem = this.bindingNavigatorCountItem;
            this.bnCostosFacturasVer.DeleteItem = null;
            this.bnCostosFacturasVer.Dock = System.Windows.Forms.DockStyle.None;
            this.bnCostosFacturasVer.Font = new Font("Arial", 11.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            this.bnCostosFacturasVer.GripMargin = new System.Windows.Forms.Padding(0);
            this.bnCostosFacturasVer.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            this.bnCostosFacturasVer.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.bindingNavigatorMoveFirstItem,
            this.bindingNavigatorMovePreviousItem,
            this.bindingNavigatorSeparator,
            this.bindingNavigatorPositionItem,
            this.bindingNavigatorCountItem,
            this.bindingNavigatorSeparator1,
            this.bindingNavigatorMoveNextItem,
            this.bindingNavigatorMoveLastItem,
            this.bindingNavigatorSeparator2,
            this.bindingNavigatorAddNewItem,
            this.tsbEditarFactura,
            this.bnVerFacturasEliminarFactura,
            this.tsbVerElementosAsociados,
            this.tssbConfigurarVerFactura,
            this.tsbQuitarFiltro,
            this.tsbImportarFactura,
            this.tsbExportarFactura});
            this.bnCostosFacturasVer.Location = new Point(20, 10);
            this.bnCostosFacturasVer.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
            this.bnCostosFacturasVer.MoveLastItem = this.bindingNavigatorMoveLastItem;
            this.bnCostosFacturasVer.MoveNextItem = this.bindingNavigatorMoveNextItem;
            this.bnCostosFacturasVer.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
            this.bnCostosFacturasVer.Name = "bnCostosFacturasVer";
            this.bnCostosFacturasVer.Padding = new System.Windows.Forms.Padding(0);
            this.bnCostosFacturasVer.PositionItem = this.bindingNavigatorPositionItem;
            this.bnCostosFacturasVer.Size = new Size(762, 25);
            this.bnCostosFacturasVer.Text = "bnCostosFacturasVer";
            // 
            // bindingNavigatorMovePreviousItem
            // 
            this.bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.bindingNavigatorMovePreviousItem.Image = ((System.Drawing.Image)(Properties.Resources.bindingNavigatorMovePreviousItem_Image));
            this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
            this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
            this.bindingNavigatorMovePreviousItem.Size = new System.Drawing.Size(23, 22);
            this.bindingNavigatorMovePreviousItem.Text = "Mover anterior";
            // 
            // bindingNavigatorSeparator
            // 
            this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
            this.bindingNavigatorSeparator.Size = new System.Drawing.Size(6, 25);
            // 
            // bindingNavigatorPositionItem
            // 
            this.bindingNavigatorPositionItem.AccessibleName = "Posición";
            this.bindingNavigatorPositionItem.AutoSize = false;
            this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
            this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
            this.bindingNavigatorPositionItem.Text = "0";
            this.bindingNavigatorPositionItem.ToolTipText = "Posición actual";
            // 
            // bindingNavigatorCountItem
            // 
            this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
            this.bindingNavigatorCountItem.Size = new System.Drawing.Size(46, 22);
            this.bindingNavigatorCountItem.Text = "de {0}";
            this.bindingNavigatorCountItem.ToolTipText = "Número total de elementos";
            // 
            // bindingNavigatorMoveFirstItem
            // 
            this.bindingNavigatorMoveFirstItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(Properties.Resources.bindingNavigatorMoveFirstItem_Image)); 
            this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
            this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
            this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(23, 22);
            this.bindingNavigatorMoveFirstItem.Text = "Primer Registro";
            // 
            // bindingNavigatorSeparator1
            // 
            this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator";
            this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 25);
            // 
            // bindingNavigatorMoveNextItem
            // 
            this.bindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.bindingNavigatorMoveNextItem.Image = ((System.Drawing.Image)(Properties.Resources.bindingNavigatorMoveNextItem_Image)); 
            this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
            this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
            this.bindingNavigatorMoveNextItem.Size = new System.Drawing.Size(23, 22);
            this.bindingNavigatorMoveNextItem.Text = "Mover siguiente";
            // 
            // bindingNavigatorMoveLastItem
            // 
            this.bindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.bindingNavigatorMoveLastItem.Image = ((System.Drawing.Image)(Properties.Resources.bindingNavigatorMoveLastItem_Image)); 
            this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
            this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
            this.bindingNavigatorMoveLastItem.Size = new System.Drawing.Size(23, 22);
            this.bindingNavigatorMoveLastItem.Text = "Último Registro";
            // 
            // bindingNavigatorSeparator2
            // 
            this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator";
            this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 25);
            // 
            // bindingNavigatorAddNewItem
            // 
            this.bindingNavigatorAddNewItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.bindingNavigatorAddNewItem.Image = ((System.Drawing.Image)(Properties.Resources.bindingNavigatorAddNewItem_Image)); 
            this.bindingNavigatorAddNewItem.Name = "bindingNavigatorAddNewItem";
            this.bindingNavigatorAddNewItem.RightToLeftAutoMirrorImage = true;
            this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(23, 22);
            this.bindingNavigatorAddNewItem.Text = "Agregar nuevo";
            this.bindingNavigatorAddNewItem.Click += new System.EventHandler(this.bindingNavigatorAddNewItem_Click);
            // 
            // tsbEditarFactura
            // 
            this.tsbEditarFactura.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.tsbEditarFactura.Image = global::ProjectA.Properties.Resources.bt_EditarFactura;
            this.tsbEditarFactura.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.tsbEditarFactura.Name = "tsbEditarFactura";
            this.tsbEditarFactura.Size = new System.Drawing.Size(23, 22);
            this.tsbEditarFactura.Text = "Editar Factura";
            this.tsbEditarFactura.Click += new System.EventHandler(this.tsbEditarFactura_Click);
            // 
            // tsbImportarFactura
            // 
            this.tsbImportarFactura.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.tsbImportarFactura.Image = global::ProjectA.Properties.Resources.bt_importar;
            this.tsbImportarFactura.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.tsbImportarFactura.Name = "tsbImportarFactura";
            this.tsbImportarFactura.Size = new System.Drawing.Size(23, 22);
            this.tsbImportarFactura.Text = "Importar Factura";
            this.tsbImportarFactura.Click += new System.EventHandler(this.tsbImportarFactura_Click);
            // 
            // tsbExportarFactura
            // 
            this.tsbExportarFactura.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.tsbExportarFactura.Image = global::ProjectA.Properties.Resources.bt_exportar;
            this.tsbExportarFactura.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.tsbExportarFactura.Name = "tsbExportarFactura";
            this.tsbExportarFactura.Size = new System.Drawing.Size(23, 22);
            this.tsbExportarFactura.Text = "Exportar Factura";
            this.tsbExportarFactura.Click += new System.EventHandler(this.tsbExportarFactura_Click); 
            // 
            // bnVerFacturasEliminarFactura
            // 
            this.bnVerFacturasEliminarFactura.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.bnVerFacturasEliminarFactura.Image = ((System.Drawing.Image)(Properties.Resources.bindingNavigatorDeleteItem_Image));
            this.bnVerFacturasEliminarFactura.Name = "bnVerFacturasEliminarFactura";
            this.bnVerFacturasEliminarFactura.RightToLeftAutoMirrorImage = true;
            this.bnVerFacturasEliminarFactura.Size = new System.Drawing.Size(23, 22);
            this.bnVerFacturasEliminarFactura.Text = "Eliminar";
            this.bnVerFacturasEliminarFactura.Click += new System.EventHandler(this.bindingNavigatorDeleteItem_Click);
            // 
            // toolStripButton7
            // 
            this.tsbVerElementosAsociados.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.tsbVerElementosAsociados.Image = global::ProjectA.Properties.Resources.bt_VerElementos; 
            this.tsbVerElementosAsociados.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.tsbVerElementosAsociados.Name = "toolStripButton7";
            this.tsbVerElementosAsociados.Size = new System.Drawing.Size(23, 22);
            this.tsbVerElementosAsociados.Text = "Ver Elementos Asociados";
            this.tsbVerElementosAsociados.Click += new System.EventHandler(this.tsbVerElementosAsociados_Click);
            // 
            // tssbConfigurarVerFactura
            // 
            this.tssbConfigurarVerFactura.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.tssbConfigurarVerFactura.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.tsmiNoFactura,
            this.tsmiNoOrden,
            this.tsmiNoRadicacion,
            this.tsmiFechaRadicacion,
            this.tsmiFechaRegistro,
            this.tsmiFechaFactura,
            this.tsmiDiasVenci,
            this.tsmiMoneda,
            this.tsmiTRM,
            this.tsmiIVA,
            this.tsmiCostoTotalFactura,
            this.tsmiPorcentajeAvance,
            this.tsmiAmortizacionAvance,
            this.tsmiTotalDescuentos,
            this.tsmiTotalPagar,
            this.tsmiTotalCancelado,
            this.tsmiDiferencia});
            this.tssbConfigurarVerFactura.Image = global::ProjectA.Properties.Resources.bt_ConfigurarColumnas;
            this.tssbConfigurarVerFactura.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.tssbConfigurarVerFactura.Name = "tssbConfigurarVerFactura";
            this.tssbConfigurarVerFactura.Size = new System.Drawing.Size(32, 22);
            this.tssbConfigurarVerFactura.Text = "Configurar Tabla ";
            this.tssbConfigurarVerFactura.DropDown.Closing += new ToolStripDropDownClosingEventHandler(tssbConfigurarVerFactura_Closing);
            this.tssbConfigurarVerFactura.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.tssbConfigurarVerFactura_DropDownItemClicked);
            
            
            // 
            // tsbQuitarFiltro
            // 
            this.tsbQuitarFiltro.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
            this.tsbQuitarFiltro.Image = global::ProjectA.Properties.Resources.bt_QuitarFiltro;
            this.tsbQuitarFiltro.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.tsbQuitarFiltro.Name = "tsbQuitarFiltro";
            this.tsbQuitarFiltro.Size = new System.Drawing.Size(23, 22);
            this.tsbQuitarFiltro.Text = "Quitar Filtro";
            this.tsbQuitarFiltro.Enabled = false;
            this.tsbQuitarFiltro.Click += new System.EventHandler(this.tsbQuitarFiltro_Click);
            // 
            // tsmiTotalCancelado
            // 
            this.tsmiTotalCancelado.CheckOnClick = true;
            this.tsmiTotalCancelado.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiTotalCancelado.Name = "TotalCancelado";
            this.tsmiTotalCancelado.Size = new System.Drawing.Size(188, 22);
            this.tsmiTotalCancelado.Text = "Total Cancelado";
            this.tsmiTotalCancelado.Click += new System.EventHandler(this.tsmiTotalCancelado_Click);
            // 
            // tsmiDiferencia
            // 
            this.tsmiDiferencia.CheckOnClick = true;
            this.tsmiDiferencia.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiDiferencia.Name = "Diferencia";
            this.tsmiDiferencia.Size = new System.Drawing.Size(188, 22);
            this.tsmiDiferencia.Text = "Total pagar Proveedor";
            this.tsmiDiferencia.Click += new System.EventHandler(this.tsmiDiferencia_Click);
            // 
            // tsmiTRM
            // 
            this.tsmiTRM.CheckOnClick = true;
            this.tsmiTRM.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiTRM.Name = "TRM";
            this.tsmiTRM.Size = new System.Drawing.Size(188, 22);
            this.tsmiTRM.Text = "TRM";
            this.tsmiTRM.Click += new System.EventHandler(this.tsmiTRM_Click);
            // 
            // tsmiNoFactura
            // 
            this.tsmiNoFactura.CheckOnClick = true;
            this.tsmiNoFactura.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiNoFactura.Name = "NoFactura";
            this.tsmiNoFactura.Size = new System.Drawing.Size(188, 22);
            this.tsmiNoFactura.Text = "No. Factura";
            this.tsmiNoFactura.Click += new System.EventHandler(this.tsmiNoFactura_Click);
            // 
            // tsmiNoOrden
            // 
            this.tsmiNoOrden.CheckOnClick = true;
            this.tsmiNoOrden.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiNoOrden.Name = "NoOrden";
            this.tsmiNoOrden.Size = new System.Drawing.Size(188, 22);
            this.tsmiNoOrden.Text = "No. Orden";
            this.tsmiNoOrden.Click += new System.EventHandler(this.tsmiNoOrden_Click);
            // 
            // tsmiNoRadicacion
            // 
            this.tsmiNoRadicacion.CheckOnClick = true;
            this.tsmiNoRadicacion.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiNoRadicacion.Name = "CodigoUnicoCont";
            this.tsmiNoRadicacion.Size = new System.Drawing.Size(188, 22);
            this.tsmiNoRadicacion.Text = "Código Único Contable";
            this.tsmiNoRadicacion.Click += new System.EventHandler(this.tsmiNoRadicacion_Click);
            // 
            // tsmiFechaRadicacion
            // 
            this.tsmiFechaRadicacion.CheckOnClick = true;
            this.tsmiFechaRadicacion.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiFechaRadicacion.Name = "FechaRadicacion";
            this.tsmiFechaRadicacion.Size = new System.Drawing.Size(188, 22);
            this.tsmiFechaRadicacion.Text = "Fecha Radicación";
            this.tsmiFechaRadicacion.Click += new System.EventHandler(this.tsmiFechaRadicacion_Click);
            // 
            // tsmiFechaRegistro
            // 
            this.tsmiFechaRegistro.CheckOnClick = true;
            this.tsmiFechaRegistro.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiFechaRegistro.Name = "FechaRegistro";
            this.tsmiFechaRegistro.Size = new System.Drawing.Size(188, 22);
            this.tsmiFechaRegistro.Text = "Fecha de Registro";
            this.tsmiFechaRegistro.Click += new System.EventHandler(this.tsmiFechaRegistro_Click);
            // 
            // tsmiFechaFactura
            // 
            this.tsmiFechaFactura.CheckOnClick = true;
            this.tsmiFechaFactura.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiFechaFactura.Name = "FechaFactura";
            this.tsmiFechaFactura.Size = new System.Drawing.Size(188, 22);
            this.tsmiFechaFactura.Text = "Fecha de Factura";
            this.tsmiFechaFactura.Click += new System.EventHandler(this.tsmiFechaFactura_Click);
            // 
            // tsmiDiasVenci
            // 
            this.tsmiDiasVenci.CheckOnClick = true;
            this.tsmiDiasVenci.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiDiasVenci.Name = "DiasVencimiento";
            this.tsmiDiasVenci.Size = new System.Drawing.Size(188, 22);
            this.tsmiDiasVenci.Text = "Días de Vencimiento";
            this.tsmiDiasVenci.Click += new System.EventHandler(this.tsmiDiasVenci_Click);
            // 
            // tsmiMoneda
            // 
            this.tsmiMoneda.CheckOnClick = true;
            this.tsmiMoneda.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiMoneda.Name = "Moneda";
            this.tsmiMoneda.Size = new System.Drawing.Size(188, 22);
            this.tsmiMoneda.Text = "Moneda";
            this.tsmiMoneda.Click += new System.EventHandler(this.tsmiMoneda_Click);
            // 
            // tsmiIVA
            // 
            this.tsmiIVA.CheckOnClick = true;
            this.tsmiIVA.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiIVA.Name = "IvaFactura";
            this.tsmiIVA.Size = new System.Drawing.Size(188, 22);
            this.tsmiIVA.Text = "IVA Factura";
            this.tsmiIVA.Click += new System.EventHandler(this.tsmiIVA_Click);
            // 
            // tsmiTotalPagar
            // 
            this.tsmiTotalPagar.CheckOnClick = true;
            this.tsmiTotalPagar.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiTotalPagar.Name = "TotalPagar";
            this.tsmiTotalPagar.Size = new System.Drawing.Size(188, 22);
            this.tsmiTotalPagar.Text = "Total a pagar";
            this.tsmiTotalPagar.Click += new System.EventHandler(this.tsmiTotalPagar_Click);
            // 
            // tsmiCostoTotalFactura
            // 
            this.tsmiCostoTotalFactura.CheckOnClick = true;
            this.tsmiCostoTotalFactura.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiCostoTotalFactura.Name = "CostoTotalFactura";
            this.tsmiCostoTotalFactura.Size = new System.Drawing.Size(188, 22);
            this.tsmiCostoTotalFactura.Text = "Valor Factura";
            this.tsmiCostoTotalFactura.Click += new System.EventHandler(this.tsmiCostoTotalFactura_Click);
            // 
            // tsmiPorcentajeAvance
            // 
            this.tsmiPorcentajeAvance.CheckOnClick = true;
            this.tsmiPorcentajeAvance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiPorcentajeAvance.Name = "PorcentajeAvance";
            this.tsmiPorcentajeAvance.Size = new System.Drawing.Size(188, 22);
            this.tsmiPorcentajeAvance.Text = "% Avance";
            this.tsmiPorcentajeAvance.Click += new System.EventHandler(this.tsmiPorcentajeAvance_Click);
            // 
            // tsmiAmortizacionAvance
            // 
            this.tsmiAmortizacionAvance.CheckOnClick = true;
            this.tsmiAmortizacionAvance.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiAmortizacionAvance.Name = "AmortizacionAvance";
            this.tsmiAmortizacionAvance.Size = new System.Drawing.Size(188, 22);
            this.tsmiAmortizacionAvance.Text = "Amortización Avance";
            this.tsmiAmortizacionAvance.Click += new System.EventHandler(this.tsmiAmortizacionAvance_Click);
            // 
            // tsmiTotalDescuentos
            // 
            this.tsmiTotalDescuentos.CheckOnClick = true;
            this.tsmiTotalDescuentos.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tsmiTotalDescuentos.Name = "TotalDescuentos";
            this.tsmiTotalDescuentos.Size = new System.Drawing.Size(188, 22);
            this.tsmiTotalDescuentos.Text = "Total Descuentos";
            this.tsmiTotalDescuentos.Click += new System.EventHandler(this.tsmiTotalDescuentos_Click);

            ((System.ComponentModel.ISupportInitialize)(this.bnCostosFacturasVer)).EndInit();
            this.bnCostosFacturasVer.ResumeLayout(false);
            this.bnCostosFacturasVer.PerformLayout();
            #endregion

            this.panelCostosFacturasVer.Controls.Add(this.bnCostosFacturasVer);
            this.panelCostosFacturasVer.Controls.Add(this.dgvCostosFacturas);
            this.panelCostosFacturasVer.Controls.Add(this.lCostosFacturasVerFechaInicial);
            this.panelCostosFacturasVer.Controls.Add(this.lCostosFacturasVerFechaFinal);
            this.panelCostosFacturasVer.Controls.Add(this.lCostosFacturasVerFiltro);
            this.panelCostosFacturasVer.Controls.Add(this.lCostosFacturasVerFiltrarPor);
            this.panelCostosFacturasVer.Controls.Add(this.dtpCostosFacturasVerFechaInicial);
            this.panelCostosFacturasVer.Controls.Add(this.dtpCostosFacturasVerFechaFinal);
            this.panelCostosFacturasVer.Controls.Add(this.cbCostosFacturasVerFiltrarPor);
            this.panelCostosFacturasVer.Controls.Add(this.cbCostosFacturasVerFiltro);
            this.panelCostosFacturasVer.Controls.Add(this.btCostosFacturasVerBuscar);

            // ----------------------------------------------------------------------------------------------------------------------------------------------------------
            // Window panelCostosFacturasAgregar
            // ----------------------------------------------------------------------------------------------------------------------------------------------------------
            this.panelCostosFacturasAgregar.Location = new Point(0, 0);
            this.panelCostosFacturasAgregar.Visible = false;

            this.lCostosFacturasAgregarNoFactura = new cLabel(new Point(20, 15), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Número de factura:");
            this.lCostosFacturasAgregarNoRadicacion = new cLabel(new Point(20, 50), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Número Radicación:");
            this.lCostosFacturasAgregarOcOs = new cLabel(new Point(20, 85), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "OC-OS:");
            this.lCostosFacturasAgregarCodigoUnicoContable = new cLabel(new Point(20, 120), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Código único Con.:");
            this.lCostosFacturasAgregarFechaDeRadicacion = new cLabel(new Point(20, 155), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Fecha de factura:");
            this.lCostosFacturasAgregarFechaRegistro = new cLabel(new Point(20, 190), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Fecha de registro:");
            this.lCostosFacturasAgregarFechaFactura = new cLabel(new Point(20, 225), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Fecha de vencimiento:");
            this.lCostosFacturasAgregarMoneda = new cLabel(new Point(20, 260), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Moneda:");
            this.lCostosFacturasAgregarTRM = new cLabel(new Point(20, 295), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "TRM:");
            this.label12 = new cLabel(new Point(20, 330), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Proveedor:");
            this.label13 = new cLabel(new Point(421, 15), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "NIT:");
            this.lCostosFacturaAgregarTotalFacturado = new cLabel(new Point(421, 50), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Total facturado:           $");
            this.lCostosFacturasAgregarIVA = new cLabel(new Point(421, 85), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "IVA:");
            this.label11 = new cLabel(new Point(421, 120), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Valor IVA:                  $");                                                                                                                                                                                                                       
            this.lCostosFacturasAgregarPAvance = new cLabel(new Point(421, 155), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Avance:                       %");
            this.lCostosFacturasAgregarAmortizacionAvance = new cLabel(new Point(421, 190), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Amortización Avance:");
            this.lCostosFacturasAgregarTotalDescuentos = new cLabel(new Point(421, 225), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Total descuentos:");
            this.lCostosFacturasAgregarTotalAPagar = new cLabel(new Point(421, 260), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Total a pagar:");
            this.lCostosFacturasAgregarTotalCancelado = new cLabel(new Point(421, 295), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Total cancelado:");
            this.lCostosFacturasAgregarDiferencia = new cLabel(new Point(421, 330), new Size(170, 18), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.TopLeft, "Pagar a Proveedor:");
            this.lCostosFacturasAgregarTotalPagarAProveedor = new cLabel(new Point(589, 330), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))), Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154))))), ContentAlignment.MiddleCenter, "0");

            
            this.tbCostosFacturasAgregarNoFactura = new cTextBox(new Point(190, 15), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarNoFactura.TextAlign = HorizontalAlignment.Right;

            this.tbCostosFacturasAgregarNoRadicacion = new cTextBox(new Point(190, 50), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarNoRadicacion.TextAlign = HorizontalAlignment.Right;

            this.cbCostosFacturasAgregarOcOs.Location = new Point(190, 85);

            this.tbCostosFacturasAgregarCodigoUnicoContable = new cTextBox(new Point(190, 120), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarCodigoUnicoContable.TextAlign = HorizontalAlignment.Right;

            this.dtpCostosFacturasAgregarFechaDeRadicacion.Location = new Point(190, 155);
            this.dtpCostosFacturasAgregarFechaRegistro.Location = new Point(190, 190);
            this.dtpCostosFacturasAgregarFechaFactura.Location = new Point(190, 225);

            this.cbCostosFacturaAgregarMoneda.Location = new Point(190, 260);
            this.tbCostosFacturasAgregarTRM = new cTextBox(new Point(190, 295), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarTRM.TextAlign = HorizontalAlignment.Right;
            this.tbCostosFacturasAgregarTRM.TextChanged += new EventHandler(tbCostosFacturasAgregarTRM_TextChanged);

            this.tbCostosFacturasAgregarProveedor = new cTextBox(new Point(190, 330), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarProveedor.ReadOnly = true;
            this.tbCostosFacturasAgregarProveedor.TextAlign = HorizontalAlignment.Right;
            this.tbCostosFacturasAgregarProveedor.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsOrdenes, "NameProvider", true));
            
            this.tbCostosFacturasAgregarNIT = new cTextBox(new Point(589, 15), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarNIT.ReadOnly = true;
            this.tbCostosFacturasAgregarNIT.Text = "0"; 
            this.tbCostosFacturasAgregarNIT.TextAlign = HorizontalAlignment.Right;
            this.tbCostosFacturasAgregarNIT.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bsOrdenes, "NIT", true));

            this.tbCostosFacturaAgregarTotalFacturado = new cTextBox(new Point(589, 50), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturaAgregarTotalFacturado.TextChanged += new System.EventHandler(this.tbCostosFacturaAgregarTotalFacturado_TextChanged);

            this.chbCostosFacturasAgregarIVADeducible.Location = new Point(589, 85);

            this.tbCostosFacturasAgregarIVA = new cTextBox(new Point(589, 120), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarIVA.TextChanged += new System.EventHandler(this.tbCostosFacturasAgregarIVA_TextChanged);

            this.tblCostosFacturasAgregarPAvance = new cTextBox(new Point(589, 155), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tblCostosFacturasAgregarPAvance.TextAlign = HorizontalAlignment.Center;
            this.tblCostosFacturasAgregarPAvance.TextChanged += new System.EventHandler(this.tblCostosFacturasAgregarPAvance_TextChanged);

            this.tbCostosFacturasAgregarAmortizacionAvance = new cTextBox(new Point(589, 190), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarAmortizacionAvance.ReadOnly = true;
            this.tbCostosFacturasAgregarAmortizacionAvance.Text = "0";
            this.tbCostosFacturasAgregarAmortizacionAvance.TextAlign = HorizontalAlignment.Right;

            this.tbCostosFacturasAgregarTotalDescuentos = new cTextBox(new Point(589, 225), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarTotalDescuentos.ReadOnly = true;
            this.tbCostosFacturasAgregarTotalDescuentos.Text = "0";
            this.tbCostosFacturasAgregarTotalDescuentos.TextAlign = HorizontalAlignment.Right;

            this.tbCostosFacturasAgregarTotalAPagar = new cTextBox(new Point(589, 260), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarTotalAPagar.ReadOnly = true;
            this.tbCostosFacturasAgregarTotalAPagar.Text = "0";
            this.tbCostosFacturasAgregarTotalAPagar.TextAlign = HorizontalAlignment.Right;

            this.tbCostosFacturasAgregarTotalCancelado = new cTextBox(new Point(589, 295), new Size(180, 25), new Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))), null, null);
            this.tbCostosFacturasAgregarTotalCancelado.Text = "0";
            this.tbCostosFacturasAgregarTotalCancelado.TextAlign = HorizontalAlignment.Right;
            this.tbCostosFacturasAgregarTotalCancelado.TextChanged += new System.EventHandler(this.tbCostosFacturasAgregarTotalCancelado_TextChanged);

            this.btCostosFacturasAgregarGuardar = new cButton(new Point(261, 380), new Size(122, 33), new EventHandler(btGuardar_Click), Properties.Resources.bt_guardar_facturas_1, Properties.Resources.bt_guardar_facturas_2, Properties.Resources.bt_guardar_facturas_3, Properties.Resources.bt_guardar_facturas_4);
            this.btCostosFacturasAgregarCancelar = new cButton(new Point(418, 380), new Size(122, 33), new EventHandler(btEliminar_Click), Properties.Resources.bt_cancelar_facturas_1, Properties.Resources.bt_cancelar_facturas_2, Properties.Resources.bt_cancelar_facturas_3, Properties.Resources.bt_cancelar_facturas_4);

            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarNoFactura);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarNoRadicacion);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarOcOs);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarCodigoUnicoContable);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarFechaDeRadicacion);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarFechaRegistro);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarFechaFactura);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarMoneda);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarTRM);
            this.panelCostosFacturasAgregar.Controls.Add(this.label12);
            this.panelCostosFacturasAgregar.Controls.Add(this.label13);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturaAgregarTotalFacturado);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarIVA);
            this.panelCostosFacturasAgregar.Controls.Add(this.label11);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarPAvance);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarAmortizacionAvance);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarTotalDescuentos);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarTotalAPagar);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarTotalCancelado);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarDiferencia);
            this.panelCostosFacturasAgregar.Controls.Add(this.lCostosFacturasAgregarTotalPagarAProveedor);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarNoFactura);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarNoRadicacion);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarCodigoUnicoContable);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarTRM);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarProveedor);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarNIT);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturaAgregarTotalFacturado);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarIVA);
            this.panelCostosFacturasAgregar.Controls.Add(this.tblCostosFacturasAgregarPAvance);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarAmortizacionAvance);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarTotalDescuentos);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarTotalAPagar);
            this.panelCostosFacturasAgregar.Controls.Add(this.tbCostosFacturasAgregarTotalCancelado);
            this.panelCostosFacturasAgregar.Controls.Add(this.cbCostosFacturasAgregarOcOs);
            this.panelCostosFacturasAgregar.Controls.Add(this.cbCostosFacturaAgregarMoneda);
            this.panelCostosFacturasAgregar.Controls.Add(this.dtpCostosFacturasAgregarFechaDeRadicacion);
            this.panelCostosFacturasAgregar.Controls.Add(this.dtpCostosFacturasAgregarFechaRegistro);
            this.panelCostosFacturasAgregar.Controls.Add(this.dtpCostosFacturasAgregarFechaFactura);
            this.panelCostosFacturasAgregar.Controls.Add(this.chbCostosFacturasAgregarIVADeducible);
            this.panelCostosFacturasAgregar.Controls.Add(this.btCostosFacturasAgregarGuardar);
            this.panelCostosFacturasAgregar.Controls.Add(this.btCostosFacturasAgregarCancelar);


            this.Controls.Add(panelCostosFacturasVer);
            this.Controls.Add(panelCostosFacturasAgregar);
        }

       


        //FormaPrincipal
        private frmPrincipal frmPrincipal { get; set; }

        // Panel panelCostosFacturasAgregar
        public cLabel lCostosFacturasAgregarNoFactura { get; set; }
        public cLabel lCostosFacturasAgregarNoRadicacion { get; set; }
        public cLabel lCostosFacturasAgregarOcOs { get; set; }
        public cLabel lCostosFacturasAgregarCodigoUnicoContable { get; set; }
        public cLabel lCostosFacturasAgregarFechaDeRadicacion { get; set; }
        public cLabel lCostosFacturasAgregarFechaRegistro { get; set; }
        public cLabel lCostosFacturasAgregarFechaFactura { get; set; }
        public cLabel lCostosFacturasAgregarMoneda { get; set; }
        public cLabel lCostosFacturasAgregarTRM { get; set; }
        public cLabel label12 { get; set; }
        public cLabel label13 { get; set; }
        public cLabel lCostosFacturaAgregarTotalFacturado { get; set; }
        public cLabel lCostosFacturasAgregarIVA { get; set; }
        public cLabel label11 { get; set; }
        public cLabel lCostosFacturasAgregarPAvance { get; set; }
        public cLabel lCostosFacturasAgregarAmortizacionAvance { get; set; }
        public cLabel lCostosFacturasAgregarTotalDescuentos { get; set; }
        public cLabel lCostosFacturasAgregarTotalAPagar { get; set; }
        public cLabel lCostosFacturasAgregarTotalCancelado { get; set; }
        public cLabel lCostosFacturasAgregarDiferencia { get; set; }
        public cLabel lCostosFacturasAgregarTotalPagarAProveedor { get; set; }

        public cTextBox tbCostosFacturasAgregarNoFactura { get; set; }
        public cTextBox tbCostosFacturasAgregarNoRadicacion { get; set; }
        public cTextBox tbCostosFacturasAgregarCodigoUnicoContable { get; set; }
        public cTextBox tbCostosFacturasAgregarProveedor { get; set; }
        public cTextBox tbCostosFacturasAgregarTRM { get; set; }
        public cTextBox tbCostosFacturasAgregarNIT { get; set; }
        public cTextBox tbCostosFacturaAgregarTotalFacturado { get; set; }
        public cTextBox tbCostosFacturasAgregarIVA { get; set; }
        public cTextBox tblCostosFacturasAgregarPAvance { get; set; }
        public cTextBox tbCostosFacturasAgregarAmortizacionAvance { get; set; }
        public cTextBox tbCostosFacturasAgregarTotalDescuentos { get; set; }
        public cTextBox tbCostosFacturasAgregarTotalAPagar { get; set; }
        public cTextBox tbCostosFacturasAgregarTotalCancelado { get; set; }

        public cButton btCostosFacturasAgregarGuardar { get; set; }
        public cButton btCostosFacturasAgregarCancelar { get; set; }

        // Panel panelCostosFacturasVer
        public cLabel lCostosFacturasVerFechaInicial { get; set; }
        public cLabel lCostosFacturasVerFechaFinal { get; set; }
        public cLabel lCostosFacturasVerFiltro { get; set; }
        public cLabel lCostosFacturasVerFiltrarPor { get; set; }
        public cButton btCostosFacturasVerBuscar { get; set; }

        //BindingNavigator
        private BindingNavigator bnCostosFacturasVer;
        private ToolStripButton bindingNavigatorAddNewItem;
        private ToolStripLabel bindingNavigatorCountItem;
        private ToolStripButton bnVerFacturasEliminarFactura;
        private ToolStripButton tsbEditarFactura;
        private ToolStripButton bindingNavigatorMoveFirstItem; //
        private ToolStripButton bindingNavigatorMovePreviousItem;
        private ToolStripSeparator bindingNavigatorSeparator;
        private ToolStripTextBox bindingNavigatorPositionItem;
        private ToolStripSeparator bindingNavigatorSeparator1;
        private ToolStripButton bindingNavigatorMoveNextItem;
        private ToolStripButton bindingNavigatorMoveLastItem; //
        private ToolStripSeparator bindingNavigatorSeparator2;
        private ToolStripButton tsbVerElementosAsociados;
        private ToolStripSplitButton tssbConfigurarVerFactura;
        private ToolStripButton tsbQuitarFiltro;
        private ToolStripButton tsbImportarFactura;
        private ToolStripButton tsbExportarFactura;
        private ToolStripMenuItem tsmiNoFactura;
        private ToolStripMenuItem tsmiNoOrden;
        private ToolStripMenuItem tsmiNoRadicacion;
        private ToolStripMenuItem tsmiFechaRadicacion;
        private ToolStripMenuItem tsmiFechaRegistro;
        private ToolStripMenuItem tsmiFechaFactura;
        private ToolStripMenuItem tsmiDiasVenci;
        private ToolStripMenuItem tsmiMoneda;
        private ToolStripMenuItem tsmiTRM;
        private ToolStripMenuItem tsmiIVA;
        private ToolStripMenuItem tsmiTotalPagar;
        private ToolStripMenuItem tsmiPorcentajeAvance;
        private ToolStripMenuItem tsmiAmortizacionAvance;
        private ToolStripMenuItem tsmiTotalDescuentos;
        private ToolStripMenuItem tsmiCostoTotalFactura;
        private ToolStripMenuItem tsmiTotalCancelado;
        private ToolStripMenuItem tsmiDiferencia;
        public BindingSource bsFacturas;
        public BindingSource bsOrdenes;
        private IContainer components;
        private DataSets.dsPrincipal dsPrincipal;
        public DataGridView dgvCostosFacturas;
        private DataGridViewTextBoxColumn ID;
        private DataGridViewTextBoxColumn NoOrden;
        private DataGridViewTextBoxColumn CentroCostoID;
        private DataGridViewTextBoxColumn NoRadicacion;
        private DataGridViewTextBoxColumn FechaRadicacion;
        private DataGridViewTextBoxColumn FechaRegistro;
        private DataGridViewTextBoxColumn FechaFactura;
        private DataGridViewTextBoxColumn DiasVencimiento;
        private DataGridViewTextBoxColumn Moneda;
        private DataGridViewTextBoxColumn TRM;
        private DataGridViewTextBoxColumn CostoTotalFactura;
        private DataGridViewTextBoxColumn IvaFactura;
        private DataGridViewTextBoxColumn PorcentajeRIVA;
        private DataGridViewTextBoxColumn RetencionIVA;
        private DataGridViewTextBoxColumn PorcentajeRRenta;
        private DataGridViewTextBoxColumn RetencionRenta;
        private DataGridViewTextBoxColumn PorcentajeICA;
        private DataGridViewTextBoxColumn RetencionICA;
        private DataGridViewTextBoxColumn PorcentajeAvance;
        private DataGridViewTextBoxColumn AmortizacionAvance;
        private DataGridViewTextBoxColumn TotalDescuentos;
        private DataGridViewTextBoxColumn TotalPagar;
        private DataGridViewTextBoxColumn NoFactura;
        private DataGridViewTextBoxColumn TotalCancelado;
        private DataGridViewTextBoxColumn Diferencia;
        public cDateTimePicker dtpCostosFacturasVerFechaInicial;
        private cDateTimePicker dtpCostosFacturasVerFechaFinal;
        private cComboBox cbCostosFacturasVerFiltrarPor;
        private cComboBox cbCostosFacturasVerFiltro;
        public cWindow panelCostosFacturasAgregar;
        private cComboBox cbCostosFacturasAgregarOcOs;
        private cComboBox cbCostosFacturaAgregarMoneda;
        private cDateTimePicker dtpCostosFacturasAgregarFechaDeRadicacion;
        private cDateTimePicker dtpCostosFacturasAgregarFechaRegistro;
        private cDateTimePicker dtpCostosFacturasAgregarFechaFactura;
        private cCheckBox chbCostosFacturasAgregarIVADeducible;
        private ComponentResourceManager resources;

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.panelCostosFacturasVer = new ProjectA.Controls.cWindow();
            this.dgvCostosFacturas = new System.Windows.Forms.DataGridView();
            this.ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.NoOrden = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.CentroCostoID = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.NoRadicacion = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.FechaRadicacion = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.FechaRegistro = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.FechaFactura = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.DiasVencimiento = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Moneda = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.TRM = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.CostoTotalFactura = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.IvaFactura = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.PorcentajeRIVA = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.RetencionIVA = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.PorcentajeRRenta = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.RetencionRenta = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.PorcentajeICA = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.RetencionICA = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.PorcentajeAvance = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.AmortizacionAvance = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.TotalDescuentos = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.TotalPagar = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.NoFactura = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.TotalCancelado = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Diferencia = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.bsFacturas = new System.Windows.Forms.BindingSource(this.components);
            this.dsPrincipal = new ProjectA.DataSets.dsPrincipal();
            this.bsOrdenes = new System.Windows.Forms.BindingSource(this.components);
            this.dtpCostosFacturasVerFechaInicial = new ProjectA.Controls.cDateTimePicker();
            this.dtpCostosFacturasVerFechaFinal = new ProjectA.Controls.cDateTimePicker();
            this.cbCostosFacturasVerFiltrarPor = new ProjectA.Controls.cComboBox();
            this.cbCostosFacturasVerFiltro = new ProjectA.Controls.cComboBox();
            this.panelCostosFacturasAgregar = new ProjectA.Controls.cWindow();
            this.cbCostosFacturasAgregarOcOs = new ProjectA.Controls.cComboBox();
            this.cbCostosFacturaAgregarMoneda = new ProjectA.Controls.cComboBox();
            this.dtpCostosFacturasAgregarFechaDeRadicacion = new ProjectA.Controls.cDateTimePicker();
            this.dtpCostosFacturasAgregarFechaRegistro = new ProjectA.Controls.cDateTimePicker();
            this.dtpCostosFacturasAgregarFechaFactura = new ProjectA.Controls.cDateTimePicker();
            this.chbCostosFacturasAgregarIVADeducible = new ProjectA.Controls.cCheckBox();
            this.bsProveedor = new System.Windows.Forms.BindingSource(this.components);
            this.bsFacturasBackUp = new System.Windows.Forms.BindingSource(this.components);
            ((System.ComponentModel.ISupportInitialize)(this.dgvCostosFacturas)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsFacturas)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dsPrincipal)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsOrdenes)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsProveedor)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsFacturasBackUp)).BeginInit();
            this.SuspendLayout();
            // 
            // panelCostosFacturasVer
            // 
            this.panelCostosFacturasVer.ImageBackGroundPage = null;
            this.panelCostosFacturasVer.Location = new System.Drawing.Point(0, 0);
            this.panelCostosFacturasVer.Margin = new System.Windows.Forms.Padding(0);
            this.panelCostosFacturasVer.Name = "panelCostosFacturasVer";
            this.panelCostosFacturasVer.Size = new System.Drawing.Size(801, 426);
            this.panelCostosFacturasVer.TabIndex = 0;
            // 
            // dgvCostosFacturas
            // 
            this.dgvCostosFacturas.AllowUserToAddRows = false;
            this.dgvCostosFacturas.AllowUserToDeleteRows = false;
            this.dgvCostosFacturas.AllowUserToOrderColumns = true;
            this.dgvCostosFacturas.AutoGenerateColumns = false;
            this.dgvCostosFacturas.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvCostosFacturas.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.NoFactura,
            this.NoOrden,
            this.NoRadicacion,
            this.FechaRadicacion,
            this.FechaRegistro,
            this.FechaFactura,
            this.DiasVencimiento,
            this.Moneda,
            this.TRM,
            this.CostoTotalFactura,
            this.IvaFactura,
            this.PorcentajeAvance,
            this.AmortizacionAvance,
            this.TotalDescuentos,
            this.TotalPagar,
            this.TotalCancelado,
            this.Diferencia,
            this.ID,});
            this.dgvCostosFacturas.DataSource = this.bsFacturas;
            this.dgvCostosFacturas.Location = new System.Drawing.Point(0, 0);
            this.dgvCostosFacturas.Margin = new System.Windows.Forms.Padding(0);
            this.dgvCostosFacturas.Name = "dgvCostosFacturas";
            this.dgvCostosFacturas.ReadOnly = true;
            this.dgvCostosFacturas.Size = new System.Drawing.Size(762, 300);
            this.dgvCostosFacturas.TabIndex = 0;
            this.dgvCostosFacturas.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvCostosFacturas_CellClick);
            // 
            // ID
            // 
            this.ID.DataPropertyName = "ID";
            this.ID.HeaderText = "ID";
            this.ID.Name = "ID";
            this.ID.ReadOnly = true;
            this.ID.Visible = false;
            // 
            // NoOrden
            // 
            this.NoOrden.DataPropertyName = "NoOrden";
            this.NoOrden.HeaderText = "No. OC - OS";
            this.NoOrden.Name = "NoOrden";
            this.NoOrden.ReadOnly = true;
            // 
            // CentroCostoID
            // 
            this.CentroCostoID.DataPropertyName = "CentroCostoID";
            this.CentroCostoID.HeaderText = "CentroCostoID";
            this.CentroCostoID.Name = "CentroCostoID";
            this.CentroCostoID.ReadOnly = true;
            // 
            // NoRadicacion
            // 
            this.NoRadicacion.DataPropertyName = "CodigoUnicoCont";
            this.NoRadicacion.HeaderText = "Código Único Contable";
            this.NoRadicacion.Name = "CodigoUnicoCont";
            this.NoRadicacion.ReadOnly = true;
            // 
            // FechaRadicacion
            // 
            this.FechaRadicacion.DataPropertyName = "FechaRadicacion";
            this.FechaRadicacion.HeaderText = "Fecha Radicacion";
            this.FechaRadicacion.Name = "FechaRadicacion";
            this.FechaRadicacion.ReadOnly = true;
            // 
            // FechaRegistro
            // 
            this.FechaRegistro.DataPropertyName = "FechaRegistro";
            this.FechaRegistro.HeaderText = "Fecha Registro";
            this.FechaRegistro.Name = "FechaRegistro";
            this.FechaRegistro.ReadOnly = true;
            // 
            // FechaFactura
            // 
            this.FechaFactura.DataPropertyName = "FechaFactura";
            this.FechaFactura.HeaderText = "Fecha Factura";
            this.FechaFactura.Name = "FechaFactura";
            this.FechaFactura.ReadOnly = true;
            // 
            // DiasVencimiento
            // 
            this.DiasVencimiento.DataPropertyName = "DiasVencimiento";
            this.DiasVencimiento.HeaderText = "Dias Vencimiento";
            this.DiasVencimiento.Name = "DiasVencimiento";
            this.DiasVencimiento.ReadOnly = true;
            // 
            // Moneda
            // 
            this.Moneda.DataPropertyName = "Moneda";
            this.Moneda.HeaderText = "Moneda";
            this.Moneda.Name = "Moneda";
            this.Moneda.ReadOnly = true;
            // 
            // TRM
            // 
            this.TRM.DataPropertyName = "TRM";
            this.TRM.HeaderText = "TRM";
            this.TRM.Name = "TRM";
            this.TRM.ReadOnly = true;
            // 
            // CostoTotalFactura
            // 
            this.CostoTotalFactura.DataPropertyName = "CostoTotalFactura";
            this.CostoTotalFactura.HeaderText = "Total Facturado";
            this.CostoTotalFactura.Name = "CostoTotalFactura";
            this.CostoTotalFactura.ReadOnly = true;
            // 
            // IvaFactura
            // 
            this.IvaFactura.DataPropertyName = "IvaFactura";
            this.IvaFactura.HeaderText = "Iva Factura";
            this.IvaFactura.Name = "IvaFactura";
            this.IvaFactura.ReadOnly = true;
            // 
            // PorcentajeRIVA
            // 
            this.PorcentajeRIVA.DataPropertyName = "PorcentajeRIVA";
            this.PorcentajeRIVA.HeaderText = "% Rete IVA";
            this.PorcentajeRIVA.Name = "PorcentajeRIVA";
            this.PorcentajeRIVA.ReadOnly = true;
            // 
            // RetencionIVA
            // 
            this.RetencionIVA.DataPropertyName = "RetencionIVA";
            this.RetencionIVA.HeaderText = "Retencion IVA";
            this.RetencionIVA.Name = "RetencionIVA";
            this.RetencionIVA.ReadOnly = true;
            // 
            // PorcentajeRRenta
            // 
            this.PorcentajeRRenta.DataPropertyName = "PorcentajeRRenta";
            this.PorcentajeRRenta.HeaderText = "% Rete Renta";
            this.PorcentajeRRenta.Name = "PorcentajeRRenta";
            this.PorcentajeRRenta.ReadOnly = true;
            // 
            // RetencionRenta
            // 
            this.RetencionRenta.DataPropertyName = "RetencionRenta";
            this.RetencionRenta.HeaderText = "Retención Renta";
            this.RetencionRenta.Name = "RetencionRenta";
            this.RetencionRenta.ReadOnly = true;
            // 
            // PorcentajeICA
            // 
            this.PorcentajeICA.DataPropertyName = "PorcentajeICA";
            this.PorcentajeICA.HeaderText = "% ICA";
            this.PorcentajeICA.Name = "PorcentajeICA";
            this.PorcentajeICA.ReadOnly = true;
            // 
            // RetencionICA
            // 
            this.RetencionICA.DataPropertyName = "RetencionICA";
            this.RetencionICA.HeaderText = "Retención ICA";
            this.RetencionICA.Name = "RetencionICA";
            this.RetencionICA.ReadOnly = true;
            // 
            // PorcentajeAvance
            // 
            this.PorcentajeAvance.DataPropertyName = "PorcentajeAvance";
            this.PorcentajeAvance.HeaderText = "% Avance";
            this.PorcentajeAvance.Name = "PorcentajeAvance";
            this.PorcentajeAvance.ReadOnly = true;
            // 
            // AmortizacionAvance
            // 
            this.AmortizacionAvance.DataPropertyName = "AmortizacionAvance";
            this.AmortizacionAvance.HeaderText = "Amortización Avance";
            this.AmortizacionAvance.Name = "AmortizacionAvance";
            this.AmortizacionAvance.ReadOnly = true;
            // 
            // TotalDescuentos
            // 
            this.TotalDescuentos.DataPropertyName = "TotalDescuentos";
            this.TotalDescuentos.HeaderText = "Total Descuentos";
            this.TotalDescuentos.Name = "TotalDescuentos";
            this.TotalDescuentos.ReadOnly = true;
            // 
            // TotalPagar
            // 
            this.TotalPagar.DataPropertyName = "TotalPagar";
            this.TotalPagar.HeaderText = "Total Pagar";
            this.TotalPagar.Name = "TotalPagar";
            this.TotalPagar.ReadOnly = true;
            // 
            // TotalCancelado
            // 
            this.TotalCancelado.DataPropertyName = "TotalCancelado";
            this.TotalCancelado.HeaderText = "Total Cancelado";
            this.TotalCancelado.Name = "TotalCancelado";
            this.TotalCancelado.ReadOnly = true;
            // 
            // Diferencia
            // 
            this.Diferencia.DataPropertyName = "Diferencia";
            this.Diferencia.HeaderText = "Total pagar a Proveedor";
            this.Diferencia.Name = "Diferencia";
            this.Diferencia.ReadOnly = true;
            // 
            // NoFactura
            // 
            this.NoFactura.DataPropertyName = "NoFactura";
            this.NoFactura.HeaderText = "No. Factura";
            this.NoFactura.Name = "NoFactura";
            this.NoFactura.ReadOnly = true;
            // 
            // bsFacturas
            // 
            this.bsFacturas.DataMember = "Facturas";
            this.bsFacturas.DataSource = this.dsPrincipal;
            // 
            // dsPrincipal
            // 
            this.dsPrincipal.DataSetName = "dsPrincipal";
            this.dsPrincipal.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
            // 
            // bsOrdenes
            // 
            this.bsOrdenes.DataMember = "OrdenCompraServicios";
            this.bsOrdenes.DataSource = this.dsPrincipal;
            // 
            // dtpCostosFacturasVerFechaInicial
            // 
            this.dtpCostosFacturasVerFechaInicial.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.dtpCostosFacturasVerFechaInicial.Font = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasVerFechaInicial.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtpCostosFacturasVerFechaInicial.Location = new System.Drawing.Point(0, 0);
            this.dtpCostosFacturasVerFechaInicial.Margin = new System.Windows.Forms.Padding(0);
            this.dtpCostosFacturasVerFechaInicial.MinDate = new System.DateTime(2013, 1, 1, 0, 0, 0, 0);
            this.dtpCostosFacturasVerFechaInicial.Name = "dtpCostosFacturasVerFechaInicial";
            this.dtpCostosFacturasVerFechaInicial.Size = new System.Drawing.Size(180, 25);
            this.dtpCostosFacturasVerFechaInicial.TabIndex = 0;
            // 
            // dtpCostosFacturasVerFechaFinal
            // 
            this.dtpCostosFacturasVerFechaFinal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.dtpCostosFacturasVerFechaFinal.CalendarFont = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasVerFechaFinal.Font = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasVerFechaFinal.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtpCostosFacturasVerFechaFinal.Location = new System.Drawing.Point(0, 0);
            this.dtpCostosFacturasVerFechaFinal.Margin = new System.Windows.Forms.Padding(0);
            this.dtpCostosFacturasVerFechaFinal.MinDate = new System.DateTime(2013, 1, 1, 0, 0, 0, 0);
            this.dtpCostosFacturasVerFechaFinal.Name = "dtpCostosFacturasVerFechaFinal";
            this.dtpCostosFacturasVerFechaFinal.Size = new System.Drawing.Size(180, 25);
            this.dtpCostosFacturasVerFechaFinal.TabIndex = 0;
            // 
            // cbCostosFacturasVerFiltrarPor
            // 
            this.cbCostosFacturasVerFiltrarPor.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.cbCostosFacturasVerFiltrarPor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbCostosFacturasVerFiltrarPor.DropDownWidth = 180;
            this.cbCostosFacturasVerFiltrarPor.Font = new System.Drawing.Font("Arial", 11.25F);
            this.cbCostosFacturasVerFiltrarPor.FormattingEnabled = true;
            this.cbCostosFacturasVerFiltrarPor.Items.AddRange(new object[] {
            "No. Factura",
            "No. OC-OS",
            "Código Único Contable",
            //"No. Radicación",
            "Fecha Radicación",
            "Fecha Factura",
            "Moneda",
            "TRM",
            "Total Facturado",
            "IVA Factura",
            "Total A Pagar",
            "Proveedor"});
            this.cbCostosFacturasVerFiltrarPor.Location = new System.Drawing.Point(0, 0);
            this.cbCostosFacturasVerFiltrarPor.Margin = new System.Windows.Forms.Padding(0);
            this.cbCostosFacturasVerFiltrarPor.Name = "cbCostosFacturasVerFiltrarPor";
            this.cbCostosFacturasVerFiltrarPor.Size = new System.Drawing.Size(180, 25);
            this.cbCostosFacturasVerFiltrarPor.TabIndex = 0;
            this.cbCostosFacturasVerFiltrarPor.SelectedIndexChanged += new System.EventHandler(this.cbCostosFacturasVerFiltrarPor_SelectedIndexChanged);
            // 
            // cbCostosFacturasVerFiltro
            // 
            this.cbCostosFacturasVerFiltro.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.cbCostosFacturasVerFiltro.DropDownWidth = 180;
            this.cbCostosFacturasVerFiltro.Font = new System.Drawing.Font("Arial", 11.25F);
            this.cbCostosFacturasVerFiltro.FormattingEnabled = true;
            this.cbCostosFacturasVerFiltro.Location = new System.Drawing.Point(0, 0);
            this.cbCostosFacturasVerFiltro.Margin = new System.Windows.Forms.Padding(0);
            this.cbCostosFacturasVerFiltro.Name = "cbCostosFacturasVerFiltro";
            this.cbCostosFacturasVerFiltro.Size = new System.Drawing.Size(180, 25);
            this.cbCostosFacturasVerFiltro.TabIndex = 0;
            // 
            // panelCostosFacturasAgregar
            // 
            this.panelCostosFacturasAgregar.ImageBackGroundPage = null;
            this.panelCostosFacturasAgregar.Location = new System.Drawing.Point(0, 0);
            this.panelCostosFacturasAgregar.Margin = new System.Windows.Forms.Padding(0);
            this.panelCostosFacturasAgregar.Name = "panelCostosFacturasAgregar";
            this.panelCostosFacturasAgregar.Size = new System.Drawing.Size(801, 426);
            this.panelCostosFacturasAgregar.TabIndex = 0;
            // 
            // cbCostosFacturasAgregarOcOs
            // 
            this.cbCostosFacturasAgregarOcOs.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.cbCostosFacturasAgregarOcOs.DataSource = this.bsOrdenes;
            this.cbCostosFacturasAgregarOcOs.DisplayMember = "NumPoSo";
            this.cbCostosFacturasAgregarOcOs.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbCostosFacturasAgregarOcOs.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.cbCostosFacturasAgregarOcOs.FormattingEnabled = true;
            this.cbCostosFacturasAgregarOcOs.Location = new System.Drawing.Point(0, 0);
            this.cbCostosFacturasAgregarOcOs.Margin = new System.Windows.Forms.Padding(0);
            this.cbCostosFacturasAgregarOcOs.Name = "cbCostosFacturasAgregarOcOs";
            this.cbCostosFacturasAgregarOcOs.Size = new System.Drawing.Size(180, 22);
            this.cbCostosFacturasAgregarOcOs.TabIndex = 20;
            this.cbCostosFacturasAgregarOcOs.ValueMember = "ID";
            // 
            // cbCostosFacturaAgregarMoneda
            // 
            this.cbCostosFacturaAgregarMoneda.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.cbCostosFacturaAgregarMoneda.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cbCostosFacturaAgregarMoneda.DropDownWidth = 180;
            this.cbCostosFacturaAgregarMoneda.Font = new System.Drawing.Font("Arial", 11.25F);
            this.cbCostosFacturaAgregarMoneda.FormattingEnabled = true;
            this.cbCostosFacturaAgregarMoneda.Items.AddRange(new object[] {
            "COP",
            "USD"});
            this.cbCostosFacturaAgregarMoneda.Location = new System.Drawing.Point(0, 0);
            this.cbCostosFacturaAgregarMoneda.Margin = new System.Windows.Forms.Padding(0);
            this.cbCostosFacturaAgregarMoneda.Name = "cbCostosFacturaAgregarMoneda";
            this.cbCostosFacturaAgregarMoneda.Size = new System.Drawing.Size(180, 25);
            this.cbCostosFacturaAgregarMoneda.TabIndex = 0;
            this.cbCostosFacturaAgregarMoneda.SelectedIndexChanged += new EventHandler(cbCostosFacturaAgregarMoneda_SelectedIndexChanged);
            // 
            // dtpCostosFacturasAgregarFechaDeRadicacion
            // 
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Anchor = System.Windows.Forms.AnchorStyles.None;
            this.dtpCostosFacturasAgregarFechaDeRadicacion.CalendarFont = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Font = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Location = new System.Drawing.Point(0, 0);
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Margin = new System.Windows.Forms.Padding(0);
            this.dtpCostosFacturasAgregarFechaDeRadicacion.MinDate = new System.DateTime(2013, 1, 1, 0, 0, 0, 0);
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Name = "dtpCostosFacturasAgregarFechaDeRadicacion";
            this.dtpCostosFacturasAgregarFechaDeRadicacion.Size = new System.Drawing.Size(180, 20);
            this.dtpCostosFacturasAgregarFechaDeRadicacion.TabIndex = 0;
            // 
            // dtpCostosFacturasAgregarFechaRegistro
            // 
            this.dtpCostosFacturasAgregarFechaRegistro.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.dtpCostosFacturasAgregarFechaRegistro.CalendarFont = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasAgregarFechaRegistro.Font = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasAgregarFechaRegistro.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtpCostosFacturasAgregarFechaRegistro.Location = new System.Drawing.Point(0, 0);
            this.dtpCostosFacturasAgregarFechaRegistro.Margin = new System.Windows.Forms.Padding(0);
            this.dtpCostosFacturasAgregarFechaRegistro.Name = "dtpCostosFacturasAgregarFechaRegistro";
            this.dtpCostosFacturasAgregarFechaRegistro.Size = new System.Drawing.Size(180, 20);
            this.dtpCostosFacturasAgregarFechaRegistro.TabIndex = 0;
            // 
            // dtpCostosFacturasAgregarFechaFactura
            // 
            this.dtpCostosFacturasAgregarFechaFactura.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
            this.dtpCostosFacturasAgregarFechaFactura.CalendarFont = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasAgregarFechaFactura.Font = new System.Drawing.Font("Arial", 11.25F);
            this.dtpCostosFacturasAgregarFechaFactura.Format = System.Windows.Forms.DateTimePickerFormat.Short;
            this.dtpCostosFacturasAgregarFechaFactura.Location = new System.Drawing.Point(0, 0);
            this.dtpCostosFacturasAgregarFechaFactura.Margin = new System.Windows.Forms.Padding(0);
            this.dtpCostosFacturasAgregarFechaFactura.MaxDate = new System.DateTime(2013, 12, 31, 0, 0, 0, 0);
            this.dtpCostosFacturasAgregarFechaFactura.MinDate = new System.DateTime(2013, 1, 1, 0, 0, 0, 0);
            this.dtpCostosFacturasAgregarFechaFactura.Name = "dtpCostosFacturasAgregarFechaFactura";
            this.dtpCostosFacturasAgregarFechaFactura.Size = new System.Drawing.Size(180, 20);
            this.dtpCostosFacturasAgregarFechaFactura.TabIndex = 0;
            // 
            // chbCostosFacturasAgregarIVADeducible
            // 
            this.chbCostosFacturasAgregarIVADeducible.AutoSize = true;
            this.chbCostosFacturasAgregarIVADeducible.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold);
            this.chbCostosFacturasAgregarIVADeducible.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(75)))), ((int)(((byte)(117)))), ((int)(((byte)(154)))));
            this.chbCostosFacturasAgregarIVADeducible.Location = new System.Drawing.Point(0, 0);
            this.chbCostosFacturasAgregarIVADeducible.Margin = new System.Windows.Forms.Padding(0);
            this.chbCostosFacturasAgregarIVADeducible.Name = "chbCostosFacturasAgregarIVADeducible";
            this.chbCostosFacturasAgregarIVADeducible.Size = new System.Drawing.Size(101, 22);
            this.chbCostosFacturasAgregarIVADeducible.TabIndex = 0;
            this.chbCostosFacturasAgregarIVADeducible.Text = "Deducible";
            this.chbCostosFacturasAgregarIVADeducible.UseVisualStyleBackColor = true;
            this.chbCostosFacturasAgregarIVADeducible.CheckedChanged += new System.EventHandler(this.chbCostosFacturasAgregarIVADeducible_CheckedChanged);
            // 
            // bsProveedor
            // 
            this.bsProveedor.DataMember = "Proveedores";
            this.bsProveedor.DataSource = this.dsPrincipal;
            ((System.ComponentModel.ISupportInitialize)(this.dgvCostosFacturas)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsFacturas)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dsPrincipal)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsOrdenes)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsProveedor)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.bsFacturasBackUp)).EndInit();
            this.ResumeLayout(false);

        }

        

        #endregion




    }
}
